package com.gzx.risk.core.apis.result;

import java.util.Map;

import com.fasterxml.jackson.annotation.JsonIgnore;

import lombok.Data;

@Data
public class RiskResult {

	@JsonIgnore
	private String groupName;// 规则组名
	@JsonIgnore
	private String dataName;
	@JsonIgnore
	private Boolean ruleResult;// 执行结果

	@JsonIgnore
	private String rejectRule;
	@JsonIgnore
	private String rejectMsg;

	@JsonIgnore
	private String dataContent;// 数据内容

	@JsonIgnore
	private String order;// 执行顺序
	@JsonIgnore
	private Long apiUsed;// api执行耗时

	public static void trim(Map<String, Object> dataMap) {
		if (dataMap == null) {
			return;
		}
		dataMap.entrySet().removeIf(entry -> entry.getValue() == null || entry.getValue().toString().equals(""));
	}
}
